from omegaconf import DictConfig


def  build_recurrent_backbone(backbone_cfg: DictConfig):
    name = backbone_cfg.name
    if name == 'MaxViTRNN_Fusion_1':
        from .maxvit_rnn_fusion_1 import RNNDetector as MaxViTRNNDetector
    elif name == 'MaxViTRNN_Fusion_2':
        from .maxvit_rnn_fusion_2 import RNNDetector as MaxViTRNNDetector
    elif name == 'MaxViTRNN':
        from .maxvit_1 import Detector as MaxViTRNNDetector
    else:
        raise NotImplementedError
    
    return MaxViTRNNDetector(backbone_cfg)
 